package com.Test;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

public class Test32 {
    public static void main(String[] args) {
        // LinkedHashMap保证顺序,按顺序输出结果
        HashMap<String, Object> hashMap = new LinkedHashMap<>();
        hashMap.put("id", 100L);
        hashMap.put("number", "123456");
        hashMap.put("weight", 10);

        for (Map.Entry<String, Object> entry : hashMap.entrySet()) {
            String data = entry.getKey() + ": " + entry.getValue();
            System.out.println(data);
        }
    }
}
